let t = require;
let e = module;
let o = e.exports;
o.default = e.exports;

('use strict');
console.log('start');
var _n121,
  i =
    (this && this.__extends) ||
    ((_n121 = function n(t, e) {
      return (_n121 =
        Object.setPrototypeOf ||
        ({
          __proto__: []
        } instanceof Array &&
          function (t, e) {
            t.__proto__ = e;
          }) ||
        function (t, e) {
          for (var o in e) {
            Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
          }
        })(t, e);
    }),
    function (t, e) {
      function o() {
        this.constructor = t;
      }
      _n121(t, e),
        (t.prototype =
          null === e
            ? Object.create(e)
            : ((o.prototype = e.prototype), new o()));
    }),
  r =
    (this && this.__decorate) ||
    function (t, e, o, n) {
      var i,
        r = arguments.length,
        a =
          r < 3
            ? e
            : null === n
            ? (n = Object.getOwnPropertyDescriptor(e, o))
            : n;
      if (
        'object' ==
          (typeof Reflect === 'undefined' ? 'undefined' : typeof Reflect) &&
        'function' == typeof Reflect.decorate
      )
        a = Reflect.decorate(t, e, o, n);
      else
        for (var s = t.length - 1; s >= 0; s--) {
          (i = t[s]) &&
            (a = (r < 3 ? i(a) : r > 3 ? i(e, o, a) : i(e, o)) || a);
        }
      return r > 3 && a && Object.defineProperty(e, o, a), a;
    };
Object.defineProperty(o, '__esModule', {
  value: !0
});
var a = t('Core'),
  s = t('SceneMrg'),
  c = t('UIMrg'),
  l = t('GlobalEventMrg'),
  u = t('ResMrg'),
  h = t('LoadingPanel'),
  p = t('MainPanel'),
  f = t('DataMrg'),
  d = t('PlayerMrg'),
  g = t('CivilizationMrg'),
  _ = t('GameSDK'),
  y = t('GeneralTips'),
  C = t('BagMrg'),
  m = t('CardMrg'),
  v = t('MilitaryMrg'),
  b = t('TalentUnlockPanel'),
  M = t('SettingMrg'),
  I = t('StoreMrg'),
  A = t('BattlePanel'),
  w = t('CustomLoader'),
  P = t('GainPanel'),
  U = t('BattleResultPanel'),
  O = t('PausePanel'),
  S = t('BuyVitPanel'),
  T = t('GuidePanel'),
  B = t('ChapterPanel'),
  L = t('StorePanel'),
  R = t('CivilizationPanel'),
  j = t('MilitaryPanel'),
  D = t('CardPanel'),
  E = t('UmaSdkHelper'),
  x = t('ScrollTips'),
  N = t('WeakGuidePanel'),
  k = t('LangCfg'),
  F = t('App'),
  G = cc._decorator,
  H = G.ccclass,
  V = G.property;
cc.Enum(F.LanguageEnum);
var z = (function (t) {
  function e() {
    var e = (null !== t && t.apply(this, arguments)) || this;
    return (e.lang = F.LanguageEnum.Chinese), e;
  }
  return (
    i(e, t),
    (e.prototype.start = function () {
      this.initUiAndScene(),
        a.Core.init(!1, !1, !1),
        _.default.init(_.SdkType.WX),
        E.default.startFrame(),
        this.initPreLoads(),
        this.startLoading();
      // w.default.downloadJsons(
      //   cc.resources.base + 'jsons.json',
      //   this.startLoading.bind(this)
      // );
    }),
    (e.prototype.initUiAndScene = function () {
      var t = new cc.Node('Scene'),
        e = new cc.Node('UiRoot'),
        o = e.addComponent(cc.Widget);
      (o.alignMode = cc.Widget.AlignMode.ON_WINDOW_RESIZE),
        (o.isAlignTop = !0),
        (o.isAlignLeft = !0),
        (o.isAlignRight = !0),
        (o.isAlignBottom = !0),
        (o.top = 0),
        (o.left = 0),
        (o.right = 0),
        (o.bottom = 0),
        this.node.addChild(t),
        s.SceneMrg.init(t),
        this.node.addChild(e),
        c.UIMrg.init(e);
    }),
    (e.prototype.startLoading = function () {
      l.default.once(
        l.GlobalEvent.LOAD_CONFIG_FINISH,
        this.onLoadConfigFinish,
        this
      ),
        l.default.once(l.GlobalEvent.LOADING_FINISH, this.onLoadFinish, this),
        c.UIMrg.show(h.LoadingPanel);
    }),
    (e.prototype.initInfos = function () {
      console.log(this.lang, 'this.langthis.lang');
      k.LangCfg.setLang(this.lang),
        f.DataMrg.register(d.PlayerMrg.ins),
        f.DataMrg.register(C.BagMrg.ins),
        f.DataMrg.register(m.CardMrg.ins),
        f.DataMrg.register(v.MilitaryMrg.ins),
        f.DataMrg.register(I.StoreMrg.ins),
        f.DataMrg.register(g.CivilizationMrg.ins),
        f.DataMrg.register(M.SettingMrg.ins),
        _.default.login();
    }),
    (e.prototype.initPreLoads = function () {
      u.ResMrg.addPreLoad('Config/data', u.LoadResType.CONFIG),
        u.ResMrg.addPreLoad('Prefab/Monster/ShiLaiMu', u.LoadResType.PREFAB),
        u.ResMrg.addPreLoad(
          'View/Main/Panel/CityPanelView',
          u.LoadResType.PREFAB
        ),
        u.ResMrg.addPreLoad(
          'Prefab/Effect/UiWeaponEffect',
          u.LoadResType.PREFAB
        ),
        u.ResMrg.addPreLoad('View/Battle/uiHurtValue', u.LoadResType.PREFAB),
        u.ResMrg.addPreLoad(y.GeneralTips, u.LoadResType.UI),
        u.ResMrg.addPreLoad(x.ScrollTips, u.LoadResType.UI),
        u.ResMrg.addPreLoad(T.GuidePanel, u.LoadResType.UI),
        u.ResMrg.addPreLoad(B.ChapterPanel, u.LoadResType.UI),
        u.ResMrg.addPreLoad(A.BattlePanel, u.LoadResType.UI),
        u.ResMrg.addPreLoad(p.MainPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad('Texture/Battle/chapter1', u.LoadResType.TEXTURE),
        u.ResMrg.addBackeLoad('Texture/Battle/chapter2', u.LoadResType.TEXTURE),
        u.ResMrg.addBackeLoad('Texture/Battle/chapter3', u.LoadResType.TEXTURE),
        u.ResMrg.addBackeLoad('Texture/Battle/chapter4', u.LoadResType.TEXTURE),
        u.ResMrg.addBackeLoad('Prefab/Effect/dao', u.LoadResType.PREFAB),
        u.ResMrg.addBackeLoad('Prefab/Effect/mofa', u.LoadResType.PREFAB),
        u.ResMrg.addBackeLoad('Prefab/Effect/jian', u.LoadResType.PREFAB),
        u.ResMrg.addBackeLoad(
          'Prefab/Effect/ZhanshiHitEffect',
          u.LoadResType.PREFAB
        ),
        u.ResMrg.addBackeLoad(
          'Prefab/Effect/MofaHitEffect',
          u.LoadResType.PREFAB
        ),
        u.ResMrg.addBackeLoad(
          'Prefab/Effect/SheshouHitEffect',
          u.LoadResType.PREFAB
        ),
        u.ResMrg.addBackeLoad(N.WeakGuidePanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(U.BattleResultPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(O.PausePanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(b.TalentUnlockPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(P.GainPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(M.SettingMrg, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(S.BuyVitPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(L.StorePanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(R.CivilizationPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(j.MilitaryPanel, u.LoadResType.UI),
        u.ResMrg.addBackeLoad(D.CardPanel, u.LoadResType.UI);
    }),
    (e.prototype.onLoadConfigFinish = function () {
      this.initInfos();
    }),
    (e.prototype.onLoadFinish = function () {
      u.ResMrg.startBackLoad(),
        c.UIMrg.close(h.LoadingPanel),
        c.UIMrg.show(p.MainPanel),
        E.default.enterGame();
    }),
    (e.prototype.update = function (t) {
      a.Core.update(t), s.SceneMrg.update(t);
    }),
    r(
      [
        V({
          type: F.LanguageEnum,
          displayName: '游戏语言'
        })
      ],
      e.prototype,
      'lang',
      void 0
    ),
    r([H], e)
  );
})(cc.Component);
(o.default = z), console.log('end');
module.exports = e.exports;
